package com.hj.springmybatis.service;

import com.hj.springmybatis.mappers.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional  //添加事务
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public int deleteUserById() {
        int rows = userMapper.delete("jj");
        System.out.println("rows = " + rows);
        int i = 1/0;
        return rows;
    }
}
